﻿using System;
using System.Threading.Tasks;

namespace WeShare.WeiXin.Mp.MsgEntity
{
    public abstract class BaseMsgHandler
    {
        /// <summary>
        /// 在所有事件之前执行。如设置了此回调，则任何类型的消息都会执行此回调。
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public virtual string BeforeHandler(BaseMsg msg,string originalXml)
        {
            return "";
        }
        /// <summary>
        /// 卡券审核结果事件
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public virtual string CardCheckResultHandler(CardCheckEventMsg msg)
        {
            return "";
        }
        /// <summary>
        /// 核销卡券事件
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public virtual string CardConsumeEventHandler(CardConsumeEventMsg msg)
        {
            return "";
        }
        /// <summary>
        /// 删除卡券事件
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public virtual string CardDeleteEventHandler(CardDeleteEventMsg msg)
        {
            return "";
        }
        /// <summary>
        /// 转赠卡券事件推送
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public virtual string CardGiftingEventHandler(CardGiftingEventMsg msg)
        {
            return "";
        }
        /// <summary>
        /// 券点流水详情事件
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public virtual string CardPayOrderEventHandler(CardPayOrderEventMsg msg)
        {
            return "";
        }
        /// <summary>
        /// 库存报警事件
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public virtual string CardSkuRemindEventHandler(CardSkuRemindEventMsg msg)
        {
            return "";
        }
        /// <summary>
        /// 进入会员卡事件
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public virtual string CardViewEventHandler(CardViewEventMsg msg)
        {
            return "";
        }
        /// <summary>
        /// 从卡券进入公众号会话事件推送
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public virtual string EnterMpFromCardEventHandler(EnterMpFromCardEventMsg msg)
        {
            return "";
        }
        /// <summary>
        /// 事件推送群发结果
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public virtual string GroupSendJobHandler(GroupSendJobEventMsg msg)
        {
            return "";
        }
        /// <summary>
        /// 图片消息回调
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public virtual string ImageHandler(ImgMsg msg)
        {
            return "";
        }
        /// <summary>
        /// 链接消息回调
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public virtual string LinkHandler(LinkMsg msg)
        {
            return "";
        }
        /// <summary>
        /// 获取用户地理位置回调
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public virtual string LocationEventHandler(LocationEventMsg msg)
        {
            return "";
        }
        /// <summary>
        /// 位置消息回调
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public virtual string LocationHandler(LocationMsg msg)
        {
            return "";
        }
        /// <summary>
        /// click菜单事件
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public virtual string MenuClickHandler(BaseMenuEventMsg msg)
        {
            return "";
        }
        /// <summary>
        /// 通过自定义菜单进入小程序事件
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public virtual string MenuMiniProgramHandler(BaseMenuEventMsg msg)
        {
            return "";
        }
        /// <summary>
        /// 自定义菜单发送地理位置事件
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public virtual string MenuLocationHandler(LocationMenuEventMsg msg)
        {
            return "";
        }
        /// <summary>
        /// 菜单发图片事件
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public virtual string MenuPicHandler(PicMenuEventMsg msg)
        {
            return "";
        }
        /// <summary>
        /// 自定义菜单按钮扫描二维码事件.完成扫码操作后显示扫描结果（如果是URL，将进入URL），且会将扫码的结果传给开发者，开发者可以下发消息。
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public virtual string MenuScanPushHandler(ScanMenuEventMsg msg)
        {
            return "";
        }
        /// <summary>
        /// 定义菜单按钮扫描二维码事件.扫码推事件且弹出“消息接收中”提示框用户点击按钮后，微信客户端将调起扫一扫工具，完成扫码操作后，将扫码的结果传给开发者，同时收起扫一扫工具，然后弹出“消息接收中
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public virtual string MenuScanWaitHandler(ScanMenuEventMsg msg)
        {
            return "";
        }
        /// <summary>
        /// 自定义菜单跳转回调
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public virtual string MenuViewHandler(ViewEventMsg msg)
        {
            return "";
        }
        /// <summary>
        /// 门店审核事件
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public virtual string PoiNotifyHandler(PoiNotifyEventMsg msg)
        {
            return "";
        }
        /// <summary>
        /// 扫描二维码事件回调
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public virtual string ScanHandler(ScanQrEventMsg msg)
        {
            return "";
        }
        /// <summary>
        /// 接收会员信息事件
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public virtual string SubmitMemberUserInfoHandler(SubmitMemberUserInfoEventMsg msg)
        {
            return "";
        }
        /// <summary>
        /// 关注事件回调
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public virtual string SubscribeHandler(SubscribeEventMsg msg)
        {
            return "";
        }
        /// <summary>
        /// 模板消息事件推送
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public virtual string TemplateJobEventHandler(TemplateJobEventMsg msg)
        {
            return "";
        }
        /// <summary>
        /// 文本消息回调
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public virtual string TextHandler(TextMsg msg)
        {
            return "";
        }
        /// <summary>
        /// 取消关注事件回调
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public virtual string UnSubscribeHandler(EventMsg msg)
        {
            return "";
        }
        /// <summary>
        /// 会员卡内容更新事件
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public virtual string UpdateMemberCardEventHandler(UpdateMemberCardEventMsg msg)
        {
            return "";
        }
        /// <summary>
        /// 用户领取卡券事件
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public virtual string UserGetCardHandler(UserGetCardEventMsg msg)
        {
            return "";
        }
        /// <summary>
        /// 卡券内快捷支付事件
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public virtual string UserPayHandler(UserPayEventMsg msg)
        {
            return "";
        }
        /// <summary>
        /// 认证通知
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public virtual string VerifyHandler(VerifyEventMsg msg)
        {
            return "";
        }
        /// <summary>
        /// 视频消息回调
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public virtual string VideoHandler(VideoMsg msg)
        {
            return "";
        }
        /// <summary>
        /// 语音消息回调
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public virtual string VoiceHandler(VoiceMsg msg)
        {
            return "";
        }


#if !NET40
        /// <summary>
        /// 卡券审核结果事件
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public virtual async Task<string> CardCheckResultHandlerAsync(CardCheckEventMsg msg)
        {
            return "";
        }
        /// <summary>
        /// 通过自定义菜单进入小程序事件
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public virtual async Task<string> MenuMiniProgramHandlerAsync(BaseMenuEventMsg msg)
        {
            return "";
        }
        /// <summary>
        /// 核销卡券事件
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public virtual async Task<string> CardConsumeEventHandlerAsync(CardConsumeEventMsg msg)
        {
            return "";
        }
        /// <summary>
        /// 删除卡券事件
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public virtual async Task<string> CardDeleteEventHandlerAsync(CardDeleteEventMsg msg)
        {
            return "";
        }
        /// <summary>
        /// 转赠卡券事件推送
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public virtual async Task<string> CardGiftingEventHandlerAsync(CardGiftingEventMsg msg)
        {
            return "";
        }
        /// <summary>
        /// 券点流水详情事件
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public virtual async Task<string> CardPayOrderEventHandlerAsync(CardPayOrderEventMsg msg)
        {
            return "";
        }
        /// <summary>
        /// 在所有事件之前执行。如设置了此回调，则任何类型的消息都会执行此回调。
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public virtual async Task<string> BeforeHandlerAsync(BaseMsg msg,string originalXml)
        {
            return "";
        }
        /// <summary>
        /// 库存报警事件
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public virtual async Task<string> CardSkuRemindEventHandlerAsync(CardSkuRemindEventMsg msg)
        {
            return "";
        }
        /// <summary>
        /// 进入会员卡事件
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public virtual async Task<string> CardViewEventHandlerAsync(CardViewEventMsg msg)
        {
            return "";
        }
        /// <summary>
        /// 从卡券进入公众号会话事件推送
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public virtual async Task<string> EnterMpFromCardEventHandlerAsync(EnterMpFromCardEventMsg msg)
        {
            return "";
        }
        /// <summary>
        /// 事件推送群发结果
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public virtual async Task<string> GroupSendJobHandlerAsync(GroupSendJobEventMsg msg)
        {
            return "";
        }
        /// <summary>
        /// 图片消息回调
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public virtual async Task<string> ImageHandlerAsync(ImgMsg msg)
        {
            return "";
        }
        /// <summary>
        /// 链接消息回调
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public virtual async Task<string> LinkHandlerAsync(LinkMsg msg)
        {
            return "";
        }
        /// <summary>
        /// 获取用户地理位置回调
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public virtual async Task<string> LocationEventHandlerAsync(LocationEventMsg msg)
        {
            return "";
        }
        /// <summary>
        /// 位置消息回调
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public virtual async Task<string> LocationHandlerAsync(LocationMsg msg)
        {
            return "";
        }
        /// <summary>
        /// click菜单事件
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public virtual async Task<string> MenuClickHandlerAsync(BaseMenuEventMsg msg)
        {
            return "";
        }
        /// <summary>
        /// 自定义菜单发送地理位置事件
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public virtual async Task<string> MenuLocationHandlerAsync(LocationMenuEventMsg msg)
        {
            return "";
        }
        /// <summary>
        /// 菜单发图片事件
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public virtual async Task<string> MenuPicHandlerAsync(PicMenuEventMsg msg)
        {
            return "";
        }
        /// <summary>
        /// 自定义菜单按钮扫描二维码事件.完成扫码操作后显示扫描结果（如果是URL，将进入URL），且会将扫码的结果传给开发者，开发者可以下发消息。
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public virtual async Task<string> MenuScanPushHandlerAsync(ScanMenuEventMsg msg)
        {
            return "";
        }
        /// <summary>
        /// 定义菜单按钮扫描二维码事件.扫码推事件且弹出“消息接收中”提示框用户点击按钮后，微信客户端将调起扫一扫工具，完成扫码操作后，将扫码的结果传给开发者，同时收起扫一扫工具，然后弹出“消息接收中
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public virtual async Task<string> MenuScanWaitHandlerAsync(ScanMenuEventMsg msg)
        {
            return "";
        }
        /// <summary>
        /// 自定义菜单跳转回调
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public virtual async Task<string> MenuViewHandlerAsync(ViewEventMsg msg)
        {
            return "";
        }
        /// <summary>
        /// 门店审核事件
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public virtual async Task<string> PoiNotifyHandlerAsync(PoiNotifyEventMsg msg)
        {
            return "";
        }
        /// <summary>
        /// 扫描二维码事件回调
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public virtual async Task<string> ScanHandlerAsync(ScanQrEventMsg msg)
        {
            return "";
        }
        /// <summary>
        /// 接收会员信息事件
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public virtual async Task<string> SubmitMemberUserInfoHandlerAsync(SubmitMemberUserInfoEventMsg msg)
        {
            return "";
        }
        /// <summary>
        /// 关注事件回调
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public virtual async Task<string> SubscribeHandlerAsync(SubscribeEventMsg msg)
        {
            return "";
        }
        /// <summary>
        /// 模板消息事件推送
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public virtual async Task<string> TemplateJobEventHandlerAsync(TemplateJobEventMsg msg)
        {
            return "";
        }
        /// <summary>
        /// 文本消息回调
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public virtual async Task<string> TextHandlerAsync(TextMsg msg)
        {
            return "";
        }
        /// <summary>
        /// 取消关注事件回调
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public virtual async Task<string> UnSubscribeHandlerAsync(EventMsg msg)
        {
            return "";
        }
        /// <summary>
        /// 会员卡内容更新事件
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public virtual async Task<string> UpdateMemberCardEventHandlerAsync(UpdateMemberCardEventMsg msg)
        {
            return "";
        }
        /// <summary>
        /// 用户领取卡券事件
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public virtual async Task<string> UserGetCardHandlerAsync(UserGetCardEventMsg msg)
        {
            return "";
        }
        /// <summary>
        /// 卡券内快捷支付事件
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public virtual async Task<string> UserPayHandlerAsync(UserPayEventMsg msg)
        {
            return "";
        }
        /// <summary>
        /// 认证通知
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public virtual async Task<string> VerifyHandlerAsync(VerifyEventMsg msg)
        {
            return "";
        }
        /// <summary>
        /// 视频消息回调
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public virtual async Task<string> VideoHandlerAsync(VideoMsg msg)
        {
            return "";
        }
        /// <summary>
        /// 语音消息回调
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public virtual async Task<string> VoiceHandlerAsync(VoiceMsg msg)
        {
            return "";
        }
#endif
    }
}
